Skip to content

feat(api chart): allow customizing api chart with query or body parameters#278

Open
arnaud-moncel wants to merge 3 commits intomainfrom
feat/params-in-chart
Open

feat(api chart): allow customizing api chart with query or body parameters#278
arnaud-moncel wants to merge 3 commits intomainfrom
feat/params-in-chart

Conversation

@arnaud-moncel
Copy link
Member

@arnaud-moncel arnaud-moncel commented Mar 18, 2026

Definition of Done

General

  • Write an explicit title for the Pull Request, following Conventional Commits specification
  • Test manually the implemented changes
  • Validate the code quality (indentation, syntax, style, simplicity, readability)

Security

  • Consider the security impact of the changes made

Note

Allow API chart handlers to receive query and body parameters

  • Adds QueryStringParser.parse_chart_parameters to extract scalar (non-hash, non-array, non-nil) request params and pass them through to render_chart on both collection and datasource chart routes.
  • Extends ChartContext and the new DatasourceChartContext with a frozen parameters attr, making request params accessible to custom chart handlers.
  • Updates render_chart signatures across the decorator stack, RPC datasource/collection, and toolkit base classes to accept and forward a parameters = {} hash.
  • RPC agent chart routes now extract parameters from the incoming payload and forward them to render_chart, completing the end-to-end propagation.

Macroscope summarized d833fcf.

@qltysh
Copy link

qltysh bot commented Mar 18, 2026

5 new issues

Tool Category Rule Count
qlty Structure Function with many parameters (count = 4): render_chart 5

end

def render_chart(caller, name, record_id)
def render_chart(caller, name, record_id, parameters = {})
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function with many parameters (count = 4): render_chart [qlty:function-parameters]

attr_reader :composite_record_id, :parameters

def initialize(collection, caller, record_id)
def initialize(collection, caller, record_id, parameters = {})
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function with many parameters (count = 4): initialize [qlty:function-parameters]

end

def render_chart(_caller, name, _record_id)
def render_chart(_caller, name, _record_id, _parameters = {})
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function with many parameters (count = 4): render_chart [qlty:function-parameters]


def render_chart(caller, name, record_id)
@child_collection.render_chart(caller, name, record_id)
def render_chart(caller, name, record_id, parameters = {})
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function with many parameters (count = 4): render_chart [qlty:function-parameters]


def render_chart(caller, name, record_id)
params = build_params(chart: name, record_id: record_id)
def render_chart(caller, name, record_id, parameters = {})
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function with many parameters (count = 4): render_chart [qlty:function-parameters]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant